from aiogram.types import ReplyKeyboardMarkup, InlineKeyboardButton, \
        InlineKeyboardMarkup, KeyboardButton
from aiogram.utils.keyboard import ReplyKeyboardBuilder, InlineKeyboardBuilder

# TODO разобраться с типом tuple[str в модуле commons]
def make_keyboard(keys: tuple) -> ReplyKeyboardMarkup:
    keyboard = ReplyKeyboardBuilder()
    for k in keys:
        # TODO menu lines
        keyboard.add(KeyboardButton(text=k))
    return keyboard.as_markup(resize_keyboard=True)


def prepare_inline_keyboard(
            keys: list[tuple[str, int]],
            act_name: str
            ) -> InlineKeyboardMarkup:
    keyboard = InlineKeyboardBuilder()
    for k in keys:
        # TODO menu lines and enums
        keyboard.add(InlineKeyboardButton(
            text=k[0],
            callback_data=f'{act_name}_{k[1]}'
        ))
    return keyboard.as_markup()
